﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace _3._3_9x9
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            label1.Text = "九九乘法表\n\n";

            for (int i = 1; i < 10;i++ )

            {

                for (int j = 1; j <10;j++ )

                {

                    label1.Text =label1.Text+i+"x"+j+"="+String.Format("{0:d2}",i*j)+"   ";
                }

                label1.Text += "\n" + "\n";

            }

        }

    

        private void button3_Click(object sender, EventArgs e)
        {
            label1.Text = null;
            label1.Text = "九九乘法表\n\n";

            for (int i = 1; i < 10; i++)
            {

                for (int j = 1; j <=i; j++)
                {

                    label1.Text = label1.Text + i + "x" + j + "=" + String.Format("{0:d2}", i * j) + "   ";
                }

                label1.Text += "\n"+"\n";
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            label1.Text = null;
            label1.Text = "九九乘法表\n\n";

            for (int i = 1; i < 10; i++)
            {
                for (int k = 1; k < i; k++)
                {
                   Console.WriteLine("       ");
                   
                }
                for (int j = i; j <= 9; j++)
                {

                    label1.Text = label1.Text + i + "x" + j + "=" + String.Format("{0:d2}", i * j) + "   ";
                }

               

                label1.Text += "\n";
            }
        }
    }
}
